﻿@page
@model IndexModel
@{
    ViewData["Title"] = "Home page";
}

<hr />

<div class="container">
    <div class="row">
        <div class="col">
            <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
                <ol class="carousel-indicators">
                    <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
                    <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
                    <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
                </ol>
                <div class="carousel-inner">
                    <div class="carousel-item active">
                        <img class="d-block w-100" src="~/images/banner/banner1.png" alt="First slide">
                    </div>
                    <div class="carousel-item">
                        <img class="d-block w-100" src="~/images/banner/banner2.png" alt="Second slide">
                    </div>
                    <div class="carousel-item">
                        <img class="d-block w-100" src="~/images/banner/banner3.png" alt="Second slide">
                    </div>
                </div>
                <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
                    <span class="sr-only">Next</span>
                </a>
            </div>
        </div>

        <partial name="_TopProductPartial" model="Model.ProductList.FirstOrDefault()" />

    </div>
</div>

<div class="container mt-3">
    <div class="row">
        <div class="col-sm">
            <div class="card">
                <div class="card-header bg-primary text-white text-uppercase">
                    <i class="fa fa-star"></i> Last products
                </div>
                <div class="card-body">
                    <div class="row">

                        @foreach (var product in Model.ProductList.Take(4))
                        {
                            <div class="col-sm">
                                <partial name="_ProductItemPartial" model="@product" />
                            </div>
                        }

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="container mt-3 mb-4">
    <div class="row">
        <div class="col-sm">
            <div class="card">
                <div class="card-header bg-primary text-white text-uppercase">
                    <i class="fa fa-trophy"></i> Best products
                </div>
                <div class="card-body">
                    <div class="row">

                        @foreach (var product in Model.ProductList.TakeLast(4))
                        {
                            <div class="col-sm">
                                <partial name="_ProductItemPartial" model="@product" />
                            </div>
                        }

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
